package Chpter4;

class Student20{
	String name;
	int age;
	public Student20(String name,int age) {
		this.name=name;
		this.age=age;
	}
	public void show() {
		System.out.println("My name is "+name+",I am "+age+"years old!");
	}
}
class Undergraduate extends Student20{
	String degree;
	public Undergraduate(String name,int age,String degree) {
		super(name,age);
		this.degree=degree;
	}
	public void show() {
		System.out.println("name "+name+"age "+age+"degree "+degree);
	}
}

public class Work1 {
	public static void main(String[] args) {
		Student20 stu=new Student20("li",20);
		Undergraduate undergraduate=new Undergraduate("sun",100,"ben");
		stu.show();
		undergraduate.show();
	}

}
